<?php

require_once  $_SERVER['DOCUMENT_ROOT']."/../_lib/base/common.php";
require_once SITE_ROOT_PATH."/_lib/classes/class.newsletter.php";


$newsletter = new newsletter;
$params = array();
$row = 1;
if (($handle = fopen("emails.csv", "r")) !== FALSE) {
    while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
        //$num = count($data);
        //$row++;
       // for ($c=0; $c < $num; $c++) {
			$params['email'] = $data[0];
			$newsletter->insert_email($params);
			unset($params);
        //}
    }
    fclose($handle);
}
?>
